package cn.adelyn.base.api.rbac.feign;


import cn.adelyn.base.api.rbac.pojo.bo.CheckPermissionBO;
import cn.adelyn.common.core.response.ServerResponseEntity;
import cn.adelyn.common.feign.config.FeignInsideAuthConfig;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


/**
 * @author chengze
 * @date 2022/12/7
 * @desc 权限校验
 */
@FeignClient(name = "adelyn-base-rbac", contextId = "permission", path = "/blog/rbac")
public interface PermissionFeignClient {

	/**
	 * 校验是否有某个uri的权限
	 */
	@PostMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/permission/checkPermission")
	ServerResponseEntity<Boolean> checkPermission(@RequestBody @Valid CheckPermissionBO checkPermissionBO);

}
